.class Lcom/google/android/exoplayer/audio/AudioTrack$c;
.super Ljava/lang/Object;
.source "AudioTrack.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/google/android/exoplayer/audio/AudioTrack;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "c"
.end annotation


# instance fields
.field protected a:Landroid/media/AudioTrack;

.field private b:Z

.field private c:I

.field private d:J

.field private e:J

.field private f:J

.field private g:J

.field private h:J

.field private i:J

.field private j:J

.field private k:J

.field private l:I

.field private m:I

.field private n:J

.field protected o:F

.field protected p:F


# direct methods
.method private constructor <init>()V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->l:I

    .line 3
    iput v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->m:I

    const/high16 v0, 0x3f800000    # 1.0f

    .line 4
    iput v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->o:F

    .line 5
    iput v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->p:F

    return-void
.end method

.method synthetic constructor <init>(Lcom/google/android/exoplayer/audio/AudioTrack$a;)V
    .locals 0

    .line 6
    invoke-direct {p0}, Lcom/google/android/exoplayer/audio/AudioTrack$c;-><init>()V

    return-void
.end method


# virtual methods
.method public a()J
    .locals 8

    .line 18
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->i:J

    const-wide/16 v2, -0x1

    cmp-long v4, v0, v2

    if-eqz v4, :cond_0

    .line 19
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    mul-long v0, v0, v2

    iget-wide v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->i:J

    sub-long/2addr v0, v2

    .line 20
    iget v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->c:I

    int-to-long v2, v2

    mul-long v0, v0, v2

    const-wide/32 v2, 0xf4240

    div-long/2addr v0, v2

    .line 21
    iget-wide v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->k:J

    iget-wide v4, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->j:J

    add-long/2addr v4, v0

    invoke-static {v2, v3, v4, v5}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v0

    return-wide v0

    .line 22
    :cond_0
    iget-object v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->getPlayState()I

    move-result v0

    const/4 v1, 0x1

    const-wide/16 v2, 0x0

    if-ne v0, v1, :cond_1

    return-wide v2

    :cond_1
    const-wide v4, 0xffffffffL

    .line 23
    iget-object v1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v1}, Landroid/media/AudioTrack;->getPlaybackHeadPosition()I

    move-result v1

    int-to-long v6, v1

    and-long/2addr v4, v6

    .line 24
    iget-boolean v1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->b:Z

    if-eqz v1, :cond_3

    const/4 v1, 0x2

    if-ne v0, v1, :cond_2

    cmp-long v0, v4, v2

    if-nez v0, :cond_2

    .line 25
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->d:J

    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->f:J

    .line 26
    :cond_2
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->f:J

    add-long/2addr v4, v0

    .line 27
    :cond_3
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->d:J

    cmp-long v2, v0, v4

    if-lez v2, :cond_4

    .line 28
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->e:J

    const-wide/16 v2, 0x1

    add-long/2addr v0, v2

    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->e:J

    .line 29
    :cond_4
    iput-wide v4, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->d:J

    .line 30
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->e:J

    const/16 v2, 0x20

    shl-long/2addr v0, v2

    add-long/2addr v4, v0

    .line 31
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->h:J

    iget-wide v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->g:J

    sub-long v2, v4, v2

    long-to-float v2, v2

    iget v3, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->p:F

    mul-float v2, v2, v3

    float-to-long v2, v2

    add-long/2addr v0, v2

    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->h:J

    .line 32
    iput-wide v4, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->g:J

    return-wide v0
.end method

.method public a(F)V
    .locals 3

    .line 34
    iget-object v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a:Landroid/media/AudioTrack;

    if-eqz v0, :cond_1

    .line 35
    iget v1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->c:I

    int-to-float v1, v1

    mul-float v1, v1, p1

    float-to-int v1, v1

    .line 36
    iget v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->l:I

    if-le v1, v2, :cond_0

    iget v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->m:I

    if-ge v1, v2, :cond_0

    .line 37
    iput p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->o:F

    .line 38
    invoke-virtual {v0, v1}, Landroid/media/AudioTrack;->setPlaybackRate(I)I

    goto :goto_0

    :cond_0
    const/high16 p1, 0x3f800000    # 1.0f

    .line 39
    iput p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->o:F

    .line 40
    iget-object p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a:Landroid/media/AudioTrack;

    iget v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->c:I

    invoke-virtual {p1, v0}, Landroid/media/AudioTrack;->setPlaybackRate(I)I

    .line 41
    new-instance p1, Ljava/lang/UnsupportedOperationException;

    invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V

    throw p1

    :cond_1
    :goto_0
    return-void
.end method

.method public a(J)V
    .locals 4

    .line 14
    invoke-virtual {p0}, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->j:J

    .line 15
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    mul-long v0, v0, v2

    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->i:J

    .line 16
    iput-wide p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->k:J

    .line 17
    iget-object p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {p1}, Landroid/media/AudioTrack;->stop()V

    return-void
.end method

.method public a(Landroid/media/AudioTrack;Z)V
    .locals 2

    .line 1
    iput-object p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a:Landroid/media/AudioTrack;

    .line 2
    iput-boolean p2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->b:Z

    const-wide/16 v0, -0x1

    .line 3
    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->i:J

    const-wide/16 v0, 0x0

    .line 4
    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->d:J

    .line 5
    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->e:J

    .line 6
    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->f:J

    .line 7
    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->g:J

    .line 8
    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->h:J

    .line 9
    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->n:J

    if-eqz p1, :cond_0

    .line 10
    invoke-virtual {p1}, Landroid/media/AudioTrack;->getSampleRate()I

    move-result p2

    iput p2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->c:I

    const/4 v0, 0x1

    .line 11
    iput v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->l:I

    .line 12
    invoke-virtual {p1}, Landroid/media/AudioTrack;->getStreamType()I

    move-result p1

    invoke-static {p1}, Landroid/media/AudioTrack;->getNativeOutputSampleRate(I)I

    move-result p1

    .line 13
    invoke-static {p2, p1}, Ljava/lang/Math;->min(II)I

    move-result p1

    mul-int/lit8 p1, p1, 0x2

    iput p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->m:I

    :cond_0
    return-void
.end method

.method public a(Landroid/media/PlaybackParams;)V
    .locals 0

    .line 33
    new-instance p1, Ljava/lang/UnsupportedOperationException;

    invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V

    throw p1
.end method

.method public b()J
    .locals 4

    .line 1
    invoke-virtual {p0}, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a()J

    move-result-wide v0

    const-wide/32 v2, 0xf4240

    mul-long v0, v0, v2

    iget v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->c:I

    int-to-long v2, v2

    div-long/2addr v0, v2

    iget-wide v2, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->n:J

    add-long/2addr v0, v2

    return-wide v0
.end method

.method public b(F)V
    .locals 0

    .line 3
    iput p1, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->p:F

    return-void
.end method

.method public b(J)V
    .locals 2

    .line 2
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->n:J

    add-long/2addr v0, p1

    iput-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->n:J

    return-void
.end method

.method public c()F
    .locals 1

    .line 1
    iget v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->o:F

    return v0
.end method

.method public d()F
    .locals 1

    .line 1
    iget v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->p:F

    return v0
.end method

.method public e()J
    .locals 1

    .line 1
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V

    throw v0
.end method

.method public f()J
    .locals 1

    .line 1
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V

    throw v0
.end method

.method public g()V
    .locals 5

    .line 1
    iget-wide v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->i:J

    const-wide/16 v2, -0x1

    cmp-long v4, v0, v2

    if-eqz v4, :cond_0

    return-void

    .line 2
    :cond_0
    iget-object v0, p0, Lcom/google/android/exoplayer/audio/AudioTrack$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->pause()V

    return-void
.end method

.method public h()Z
    .locals 1

    const/4 v0, 0x0

    return v0
.end method
